const dbm = require('../config/dbModels');

class PostDao {


    /**
     * 创建文章模型
     * @param data
     * @returns {Promise<*>}
     */
    static async createPost(data) {
        return await dbm.Post.create({
                market_region: '',
                stk_name: '青岛啤酒',
                stk_code: 600999,
                range_per: "99.36",
                range_val: 45.36,
                time_begin: 1000,
                time_end: '2018-12-5 15:32',
                event_cause: '肯德基联合meat beant',
                event_result: '盘中大涨1.6%',
                tag: '肯德基,合作,人造肉',
                nickname: '阿猫',
                likeit: 45
           })
    }

    /**
     * 查询取文章详情数据
     * @param id  文章ID,即传入的postId
     * @returns {Promise<Model>}
     */
    static async getPost(id) {
        return await dbm.Post.findAll({
            where: {
                id  
            }
        })
    }
}
module.exports = PostDao
